<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript">
        window.onload = function(){
            var btn = document.getElementById('btn');
            btn.onclick = function(){
                var xhr = null;
                if(window.XMLHttpRequest){
                    xhr = new XMLHttpRequest();
                }else{
                    xhr = new ActiveXObject('Microsoft.XMLHTTP');
                }
                xhr.open('get','08.php');
                xhr.send(null);
                console.log(1);
                xhr.onreadystatechange = function(){
                    if(xhr.readyState == 4){
                        if(xhr.status == 200){
                            var data = xhr.responseText;
                            var obj = JSON.parse(data);
                            var tag = '<div><span>'+obj.info+'</span><span>-----</span><span>'+obj.message+'</span></div>';
                            var info = document.getElementById('info');
                            info.innerHTML = tag;
                            console.log(2);
                        }
                    }
                }
                console.log(3);
            }
        }
    </script>
</head>
<body>
    <div id="info"></div>
    <input type="button" value="点击" id="btn">
</body>
</html>